Function Reference

_TS_Wrapper_PrincipalSet

Set the Principal properties of a Task Definition object.

#Include <TaskScheduler.au3>
_TS_Wrapper_PrincipalSet($oTaskDefinition, $iLogonType[, $iRunLevel = $TASK_RUNLEVEL_LUA[, $sUserId = "", $sGroupId = ""]])

 

Parameters

$oTaskDefinition Task Definition object as returned by _TS_Wrapper_TaskCreate
$iLogonType Sets the security logon method that is required to run the Tasks that are associated with the principal.
$iRunLevel [optional] Sets the identifier that is used to specify the privilege level that is required to run the Tasks that are associated with the principal.
$sUserId [optional] Sets the user identifier that is required to run the Tasks that are associated with the principal.
$sGroupId [optional] Sets the group identifier that is required to run the Tasks that are associated with the principal.

 

Return Value

Success: 1
Failure: Returns 0 and sets @error:
    2801 - Error creating the Task Definition. @extended is set to the COM error code
    2802 - Parameter $oTaskDefinition is not an object or not an ITaskDefinition object

 

Remarks

Populates the RegistrationInfo object.
Either set $sUserId or $sGroupId - if any

 

Related

 

Example


#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <MsgBoxConstants.au3>

MsgBox($MB_ICONINFORMATION, "Task Scheduler UDF", "Please check example script _TS_Wrapper_TaskCreate.au3 for an example!")